package com.tencent.qf.user.controller;

import com.tencent.qf.common.pojo.HttpResult;
import com.tencent.qf.user.dal.entity.DwmUserModelInfoRt;
import com.tencent.qf.user.dto.request.UserOrderQryRequest;
import com.tencent.qf.user.service.DwmUserModelInfoRtService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @author p_daendeng@tencent.com
 * @create 2023/4/12 17:00
 */
@RestController
@Api(value = "用户订单查询", tags = "用户订单查询")
@RequestMapping("/api/user/order")
public class UserOrderQryController {

    @Resource
    private DwmUserModelInfoRtService dwmUserModelInfoRtService;

    @PostMapping(value = "/query")
    @ApiOperation(value = "根据unionid查询订单数据")
    public HttpResult<DwmUserModelInfoRt> queryOrderDataByUnionIds (@RequestBody @Valid UserOrderQryRequest request){
        return HttpResult.success(dwmUserModelInfoRtService.getUserPaymentInfoByDWN(request.getUnionId()));
    }
}
